#namespace("core.Dict")
  #sql("findByCondition")
    SELECT uuid, label, code, parentId, parentCode, serialNumber
    FROM ht_sys_dict
    #WHERE()
      #if(uuid)
        uuid = #para(uuid)
      #end
      #if(label)
        AND label = #para(label)
      #end
      #if(code)
        AND code = #para(code)
      #end
      #if(parentId)
        #if(parentId == "#")
          AND parentId IS NULL
        #else
          AND parentId = #para(parentId)
        #end
      #end
      #if(parentCode)
        AND parentCode = #para(parentCode)
      #end
    #end
    ORDER BY serialNumber
  #end

  #sql("findUuidByParentId")
    SELECT uuid
    FROM ht_sys_dict
    #WHERE()
      #if(parentId)
        AND parentId = #para(parentId)
      #end
    #end
  #end

  #sql("deleteByIds")
    DELETE FROM ht_sys_dict
    #WHERE()
      #if(uuids != null && uuids.length > 0)
        #if(uuids.length>1)
          uuid in (
          #for(tempId : uuids)
            #if(for.first)
              #para(tempId)
            #else
              , #para(tempId)
            #end
          #end
          )
        #else
          uuid = #para(uuids[0])
        #end
      #end
    #end
  #end

  #sql("updateParentCodeByParentId")
    UPDATE ht_sys_dict SET parentCode = #para(parentCode)
    WHERE parentId = #para(parentId)
  #end

  #sql("findByParentCodes")
    SELECT uuid, label, code, parentId, parentCode, serialNumber
    FROM ht_sys_dict
    #WHERE()
      #if(codes != null && codes.length > 0)
        parentCode in (
          #for(temp : codes)
            #if(for.first)
              #para(temp)
            #else
              , #para(temp)
            #end
          #end
        )
      #end
    #end
    ORDER BY parentCode
  #end

#end